package com.whfc.fvs.enums;

import com.whfc.common.exception.BizException;
import com.whfc.common.result.ResultEnum;

/**
 * @Description: 视频监控云厂商
 * @author: qzexing
 * @version: 1.0
 * @date: 2020/3/5 14:08
 */
public enum VsPlatform {

    /**
     * 海康萤石
     */
    HIK_EZVIZ(0, "海康萤石"),

    /**
     * 大华乐橙
     */
    DAHUA_IMOU(1, "大华乐橙"),

    /**
     * 阿里云RTMP
     */
    ALIYUN_RTMP(2, "阿里云RTMP"),

    /**
     * 阿里云GB28181
     */
    ALIYUN_GB28181(3, "阿里云GB28181"),

    /**
     * 直播地址播放
     */
    LIVE_URL_PLAY(4, "直播地址播放"),

    /**
     * 自定义流媒体服务器
     */
    STREAM_SERVER(5, "自定义流媒体服务器"),

    /**
     * 海康萤石GB28181
     */
    EZVIZ_GB28181(6, "海康萤石GB28181"),

    /**
     * 宇视科技
     */
    UNI(7, "宇视科技");

    private Integer value;

    private String desc;

    VsPlatform(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static VsPlatform parseValue(Integer value) {
        switch (value) {
            case 0:
                return HIK_EZVIZ;
            case 1:
                return DAHUA_IMOU;
            case 2:
                return ALIYUN_RTMP;
            case 3:
                return ALIYUN_GB28181;
            case 4:
                return LIVE_URL_PLAY;
            case 5:
                return STREAM_SERVER;
            case 6:
                return EZVIZ_GB28181;
            case 7:
                return UNI;
            default:
                throw new BizException(ResultEnum.FAILURE.getCode(), "系统错误");
        }
    }

}
